package chapter_9.variant_C;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.LinkedList;

public class Task_5 {

	public static void main(String[] args) {
		File file=new File("file.txt");
		File st=new File("st.txt");
		BufferedReader is;
		BufferedWriter si;
		LinkedList<String> strs=new LinkedList<String>();
		String str;
		try {
			is = new BufferedReader(new FileReader(file)) ;
			si = new BufferedWriter(new FileWriter(st));
			while ((str=is.readLine())!=null) 
				strs.add(str);
			for (String s: strs) {
				String[] items=s.split(" ");
				int b=0;
				for (int i=1; i<items.length;i++){
					b+=Integer.valueOf(items[i]);
				}
				if ((float)b/(items.length-1)>7)
					si.write(items[0]+"\n");
			}
			is.close();
			si.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}
